//
//  ZJMeCell.m
//  ZiJinLian
//
//  Created by lc on 2017/3/24.
//  Copyright © 2017年 lzy. All rights reserved.
//

#import "ZJMeCell.h"

@implementation ZJMeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.userInteractionEnabled=YES;
    [self addSubview:self.item];
        [_item mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.equalTo(MainW);
            make.left.equalTo(self);
            make.height.equalTo(50);
            make.top.equalTo(self);
        }];
    }
    return self;
}

-(void)setupCell:(ZJMeModel*)model{
    [self.item.btn setTitle:model.title forState:UIControlStateNormal];
    [self.item.btn setImage:[UIImage imageNamed:model.icon] forState:UIControlStateNormal];
    [self setSelectionStyle:UITableViewCellSelectionStyleNone];
}

-(ZJCommWithImageItem *)item{
    if (_item==nil) {
        _item=[[[ZJCommWithImageItem alloc]init]zjCommItemInitWithTitle:nil image:nil];
    }
    return _item;
}

@end
